package com.example.springbootmail.controller;

import com.example.springbootmail.service.IMailService;
import com.example.springbootmail.vo.MailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author LiuShanshan
 * @version V1.0
 * @Description
 */
@Controller
@RequestMapping("/mail")
public class MailController {
    @Autowired
    private IMailService mailService;

    @RequestMapping("/get")
    public void get(){
        System.out.println("开始气球");
        MailVo mailVo = new MailVo();
        mailVo.setFrom("1275601161@qq.com");
        mailVo.setTo("m1275601161@163.com");
        mailVo.setSubject("收到您朋友【"+"jarry"+"】的信件,Ta的邮箱:"+"1275601161@qq.com");
        mailVo.setText("测试邮件发送");
        mailService.sendMail(mailVo);
    }
}
